package com.yekaile.carsystem.mapper;

import com.yekaile.carsystem.entity.Role;
import com.yekaile.carsystem.entity.SystemAuthority;
import com.yekaile.carsystem.entity.User;
import com.yekaile.carsystem.entity.UserExample;

import java.util.List;

import org.apache.ibatis.annotations.Param;

public interface UserMapper {
    long countByExample(UserExample example);

    int deleteByExample(UserExample example);

    int deleteByPrimaryKey(Integer userId);

    int insert(User record);

    int insertOrUpdate(User record);

    int insertOrUpdateSelective(User record);

    int insertSelective(User record);

    List<User> selectByExample(UserExample example);

    User selectByPrimaryKey(Integer userId);

    int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example);

    int updateByExample(@Param("record") User record, @Param("example") UserExample example);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    int updateBatch(List<User> list);

    int updateBatchSelective(List<User> list);

    int batchInsert(@Param("list") List<User> list);

    List<SystemAuthority> selectAuthorities(@Param("roleIdList") List<Integer> roleIdList);


    List<SystemAuthority> selectAuthoritiesByRole(@Param("roleId") Integer roleId);

    List<Role> selectRoles(Integer userId);

    List<SystemAuthority> selectOnlyUserAuthority(@Param("userId") Integer userId);

    List<User> selectAll();


}
